#include <iostream>
#include <math.h>
#include <conio.h>

double fy(double y, double z)
{
	return -0.5*y+0.2*z;
}

double fz(double y, double z)
{
	return 0.5*y-0.2*z;
}

int main(int argc, char argv[])
{
	double h = 0.1;
	double a = 0.0;
	double b = 0.8;
	int n = (b-a) / h;
	double x = 0.0;
	double y = 10.0;
	double z = 5.0;
	double y0 = 0.0;
	std::cout << "X = " << x << "\tY = " << y << "\tZ = " << z << "\n";
	for(int i=0; i<n; i++)
	{
		y0 = y;
		y = y + h * fy(y0, z);
		z = z + h * fz(y0, z);
		x += h;
		std::cout << "X = " << x << "\tY = " << y << "\tZ = " << z << "\n";
	}

	getch();

	return 0;
}
